﻿<Window x:Class="SurveySez.View.PublicWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Survey Sez" Height="451" Width="632">
    <Window.Resources>
        <Storyboard x:Key="FadeOut">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="IncorrectGuessesTextBlock">
            	<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
            	<SplineDoubleKeyFrame KeyTime="0:0:2" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Style x:Key="IncorrectGuessTextBoxStyle" TargetType="TextBlock">
            <Setter Property="Foreground" Value="Red"/>
        </Style>
    </Window.Resources>
    
	<Window.DataContext>
		<Binding Source="{StaticResource Locator}" Path="Public.Game"/>
	</Window.DataContext>
    <Viewbox>
        <Grid>
            <Ellipse Width="700" Height="500" HorizontalAlignment="Center" VerticalAlignment="Center">
                <Ellipse.Fill>
                    <LinearGradientBrush>
                        <GradientStop Color="#759ECA" />
                        <GradientStop Color="#BEC2C6" Offset="1" />
                    </LinearGradientBrush>
                </Ellipse.Fill>
            </Ellipse>
            <Ellipse Width="680" Height="480" Fill="White" Margin="10" HorizontalAlignment="Center" VerticalAlignment="Center"/>
            <StackPanel Width="700" Height="400" HorizontalAlignment="Left" VerticalAlignment="Center">
                <TextBlock Text="{Binding Question}" FontSize="18" Margin="5" TextAlignment="Center" Width="400"/>
                <ItemsControl ItemsSource="{Binding Answers}" Margin="5">
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel />
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <DataTemplate.Resources>
                                <Style TargetType="TextBlock">
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding IsGuessed}" Value="False">
                                            <Setter Property="Visibility" Value="Hidden"/>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </DataTemplate.Resources>
                            <Border BorderThickness="3" BorderBrush="Gold" Margin="3" Width="400">
                                <TextBlock FontSize="18" Text="{Binding Response}"/>
                            </Border>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
            </StackPanel>
			<TextBlock x:Name="IncorrectGuessesTextBlock" Text="{Binding IncorrectGuesses}" FontSize="108" HorizontalAlignment="Center" VerticalAlignment="Center" Style="{StaticResource IncorrectGuessTextBoxStyle}"/>
        </Grid>
    </Viewbox>
</Window>
